fix: render server icon URLs as images instead of raw text - #57
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
Server definitions use HTTP URLs for the `icon` field (e.g., GitHub avatars), but ServerDetailModal and ServerInstallModal rendered them as raw text. Created a shared ServerIcon component that detects URL icons and renders them as <img> elements with error fallback. - Add ServerIcon component with URL detection and error handling - Fix ServerDetailModal to use ServerIcon instead of raw text - Fix ServerInstallModal to use ServerIcon instead of raw text - Refactor ServerCard to use shared ServerIcon (was inline) - Add unit tests for ServerIcon, ServerCard, ServerDetailModal - Add E2E tests verifying icons render as images in registry Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
|
|
||
| test('should render icon as img in server detail modal', async ({ page }) => { | ||
| const dashboard = new DashboardPage(page); | ||
| const registry = new RegistryPage(page); |
This was referenced Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
iconfield (e.g., GitHub avatars), butServerDetailModalandServerInstallModalrendered the URL as raw text instead of an<img>elementServerIconcomponent that detects URL-based icons and renders them as<img>elements with graceful error fallback to a 📦 emojiServerCard(which had inline URL detection) to use the shared component for consistencyChanges
ServerIconcomponent (apps/desktop/src/components/ServerIcon.tsx) — handles URL icons (<img>), emoji icons (<span>), and null/error fallbackServerDetailModal— was<div className="text-5xl">{server.icon || '📦'}</div>, now uses<ServerIcon>ServerInstallModal— was<span className="text-2xl">{server.icon}</span>, now uses<ServerIcon>ServerCard— replaced inlinestartsWith('http')check + DOM manipulation error handler with<ServerIcon><img>elements in registry cards and detail modalTest plan
pnpm test:ts(ServerIcon, ServerCard, ServerDetailModal)pnpm typecheckpnpm lint(0 new errors/warnings)pnpm test:e2e:webregistry icon rendering tests🤖 Generated with Claude Code